﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using Xiucai.BPM.Core;
using Xiucai.Common;
using Xiucai.BPM.Core.Bll;
using Xiucai.BPM.Core.Model;
using Omu.ValueInjecter;

namespace Xiucai.BPM.Admin.sys.ashx
{
    /// <summary>
    /// GetUserdev 的摘要说明
    /// </summary>
    public class GetUserdev : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int k;
            var json = HttpContext.Current.Request["json"];
            var rpm = new RequestParamModel<User>(context) { CurrentContext = context, Action = context.Request["action"] };
            if (!string.IsNullOrEmpty(json))
            {
                rpm = JSONhelper.ConvertToObject<RequestParamModel<User>>(json);
                rpm.CurrentContext = context;
            }

            switch (rpm.Action)
            {
                case "myuser":
                    string m = "";
                    string devtype = rpm.Request("uname");
                    m = UserBll.Instance.GetJsonDatadevusername(rpm.Pageindex, rpm.Pagesize, rpm.Filter, rpm.Sort, rpm.Order);
                    context.Response.Write(m);
                    break;
            }

        }


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}